package graph.weighted;

/**
 * 
 * @Title: CandyWeightedEdge.java 
 * @Package graph.weighted 
 * @Description: 带权边
 * @author CandyWall   
 * @date 2021年1月20日 下午3:08:11 
 * @version V1.0
 */
public class CandyWeightedEdge implements Comparable<CandyWeightedEdge> {
    private int v, w;
    private int weight;
    public CandyWeightedEdge(int v, int w, int weight) {
        this.v = v;
        this.w = w;
        this.weight = weight;
    }
    public int getV() {
        return v;
    }
    public int getW() {
        return w;
    }
    public int getWeight() {
        return weight;
    }
    @Override
    public String toString() {
        return "(" + v + "-" + w + " : " + weight + ")";
    }
    
    @Override
    public int compareTo(CandyWeightedEdge o) {
        return this.weight - o.weight;
    }
}